-- GENERATED SPELL FOR [Razorfen Totemic] --


function spell0_4440(pUnit, Event) --@Earthgrab Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(8376,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_4440', 1, 1)
end

function spell1_4440(pUnit, Event) --@Healing Ward,Self--
pUnit:FullCastSpellOnTarget(4971,pUnit)
pUnit:RegisterEvent('Sorts_4440', 32000, 1)
end

function Sorts_4440(pUnit, Event)
local choix_sorts_4440 = math.random(0, 1)
if choix_sorts_4440 == 0 then
pUnit:RegisterEvent('spell0_4440', 1, 1)
end
if choix_sorts_4440 == 1 then
pUnit:RegisterEvent('spell1_4440', 1, 1)
end
end

function mob4440_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_4440', math.random(1500, 3000), 1)
end

function mob4440_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4440_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4440_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(4440, 1, 'mob4440_Action')
RegisterUnitEvent(4440, 2, 'mob4440_Leave')
RegisterUnitEvent(4440, 3, 'mob4440_Kill')
RegisterUnitEvent(4440, 4, 'mob4440_Die')
